<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@page import="java.util.GregorianCalendar"%>
<%@page import="java.util.Date"%>
<%@page import="java.util.Calendar"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<HTML>
<HEAD><TITLE>advanced-actions</TITLE></HEAD>
<BODY BGCOLOR="#FDF5E6">
<H1 ALIGN="CENTER">advanced-actions</H1>
<table border="1" cellpadding="5" cellspacing="5">
	<tr>
	<th>No1</th>
	<th>No2</th>
	<th>No3</th>
	<th>No4</th>
	<th>No5</th>
	</tr>
	<td>No1</td>
	<td>No2</td>
	<td>No3</td>
	<td>No4</td>
	<td>No5</td>
	
	<%
 	Calendar calendar = new GregorianCalendar(2009, 11, 31, 23, 30, 0);
    
    // get a Date instance to represent "now" (the current date);
    // we'll need it to reset our calendar during the following date examples.
    Date currentDate = calendar.getTime();
    System.out.format("today:      %s\n", currentDate);
 
    // get the date/time one hour from now
    calendar.setTime(currentDate);
    calendar.add(Calendar.HOUR_OF_DAY, 1);
    Date oneHour = calendar.getTime();
    System.out.format("one hour:   %s\n", oneHour);
    
    // get tomorrow's date
    calendar.setTime(currentDate);
    calendar.add(Calendar.DAY_OF_YEAR, 1);
    Date tomorrow = calendar.getTime();
    System.out.format("tomorrow:   %s\n", tomorrow);

    
    // get next week's date
    // note: may want to use WEEK_OF_MONTH or WEEK_OF_YEAR
    calendar.setTime(currentDate);
    calendar.add(Calendar.DAY_OF_YEAR, 7);
    Date nextWeek = calendar.getTime();
    System.out.format("next week:  %s\n", nextWeek);
  
    // get next month
    calendar.setTime(currentDate);
    calendar.add(Calendar.MONTH, 1);
    Date nextMonth = calendar.getTime();
    System.out.format("next month: %s\n", nextMonth);
  
    // get next year
    calendar.setTime(currentDate);
    calendar.add(Calendar.YEAR, 1);
    Date nextYear = calendar.getTime();
    System.out.format("next year:  %s\n", nextYear);
	Calendar c = Calendar.getInstance();
	int monthMaxsDays = c.getActualMaximum(Calendar.DATE);
	int year = 2010;
	int month = Calendar.JANUARY;
	Calendar cal = new GregorianCalendar(year, month, 1);
	do {
	    // get the day of the week for the current day
	    int day = cal.get(Calendar.DAY_OF_WEEK);
	    // check if it is a Saturday or Sunday
	  
	        // print the day - but you could add them to a list or whatever
	        System.out.println(cal.get(Calendar.DAY_OF_MONTH));
	 
	    // advance to the next day
	    cal.add(Calendar.DAY_OF_YEAR, 1);
	}  while (cal.get(Calendar.MONTH) == month);
	%>
	<% out.println(monthMaxsDays); %>
	

</table>
<jsp:useBean id="login" class="coreservlets.UserFormBean" scope="session"/>
<td>${login.email}</td>
<UL>
  <LI><B>Input forms for examples in this section.</B>
      <UL>
        <LI><A HREF="account-control.jsp">account-control.jsp</A>
        <LI><A HREF="choose-colors1.jsp">choose-colors1.jsp</A>
        <LI><A HREF="choose-colors2.jsp">choose-colors2.jsp</A>
      </UL>
  <LI><A HREF="http://courses.coreservlets.com/Course-Materials/struts.html">
      Apache Struts 1.2 Tutorial</A>. The tutorial that this
      example was taken from.
  <LI><A HREF="http://struts.apache.org/api/index.html">Struts API.</A>
      Javadoc for all classes.
  <LI><A HREF="http://struts.apache.org/userGuide/index.html">
      Struts Developer's and User's Guides.</A> Complete
      documentation from the Apache site.
  <LI><A HREF="http://courses.coreservlets.com/#Struts-Courses">
      Jakarta Struts Training Courses.</A> Personally developed
      and taught by Marty Hall, the author of <I>Core Servlets and
      JavaServer Pages</I> and the Struts tutorial from which
      this example application was taken. Available at public venues
      or on-site at <I>your</I> location.
</UL>
</BODY></HTML>